/**
 * 
 */
package scriptrunner.execution;

import java.io.Serializable;
import java.util.ArrayList;
import java.util.Iterator;

/**
 * @author Administrator
 * 
 */
public class StatementList implements Serializable {

	/**
	 * 
	 */
	private static final long serialVersionUID = -7801377705209640158L;

	public void add(Statement s) {
		statements.add(s);
	}

	public boolean Execute(Session se) throws ExecuteErrorException {
		boolean runFinish = false;
		Iterator<Statement> i = statements.iterator();

		while (i.hasNext() && !runFinish) {
			Statement s = i.next();
			runFinish = s.Execute(se);
		}
		return runFinish;
	}

	protected ArrayList<Statement> statements = new ArrayList<Statement>();

}
